package com.niit.session23.bank;

public class Bank extends Thread {
	private  Integer money = 100000;
	private String name;

	public Bank(String name) {
		super();
		this.name = name;
	}

	@Override
	public void run() {
		while (true) {
			if (money > 0) {
				money -= 1000;
				System.out.println(name + "取走了" + money);
			} else {
				System.out.println("钱取完了");
				break;
			}
		}
	}

}
